package com.itlong.cloud.POJO.DTO.smartcard;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;
import java.util.List;

/**
 * <desc>
 *      与旺龙一卡通对接-住户设备权限信息传输对象(用于存储住户设备权限信息数据进pull表最终推送给一卡通)
 * </desc>
 *
 * @createDate 18:33 2017-11-13
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SmartCardSyncDataPullUserAuthDTO implements Serializable{

    //住户手机号
    private String userPhone;

    //住户邮箱
    private String userEmail;

    //住户设备权限
    private List<SmartCardSyncDataSysDeviceAuthDTO> sysAuths;

//    //操作类型
//    private Integer dataOperType;

//    //修改日期, 13位时间戳
//    private String modifyDate;

    @JSONField(serialize = false, deserialize = false)
    public String getDataUid(){
        String phone = StringUtils.isBlank(userPhone)? "": userPhone;
        String email = StringUtils.isBlank(userEmail)? "":userEmail;
        return phone + email;
    }
}
